{include file='public/meta' }
	<title>系统日志 - 木鱼内容管理系统</title>
</head>
<body>

 <div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layui-form layuiadmin-card-header-auto">
            <div class="layui-form-item">
              <div class="layui-inline">
                <label class="layui-form-label">日志查找</label>
                <div class="layui-input-block">
                  <input type="text" name="keywords" id="keywords" placeholder="请输入关键词" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-inline">
                <button class="layui-btn layuiadmin-btn-useradmin" type="submit" onclick="so()">
                  <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                </button>
              </div>
            </div>
        </div>

        <div class="layui-card-body">
            <div class="layui-table-body layui-table-main">
                <table class="layui-table">
                    <thead>
                        <tr>
                            
                            <th><div class="layui-table-cell" align="center"><span>ID</span></div></th>
                            <th><div class="layui-table-cell" align="center"><span>记录</span></div></th>
                            <th><div class="layui-table-cell" align="center"><span>管理员</span></div></th>
                            <th><div class="layui-table-cell" align="center"><span>客户端IP</span></div></th>
                            <th><div class="layui-table-cell" align="center"><span>时间</span></div></th>
                            <th><div class="layui-table-cell" align="center"><span>操作</span></div></th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $log as $val}
                        <tr align="center">
                            
                            <td>{$val.id}</td>
                            <td>{$val.content}</td>
                            {if condition="!empty($val['name'])"}
                        		<td>
                        			{foreach $val['name'] as $va}
                        			{$va.name}
                        			{/foreach}
                        		</td>
                    		{else /}
                    		    <td style="color:red;">异常</td>
                    		{/if}
                            <td>{$val.log_ip}</td>
                            <td>{:date("Y-m-d H:i:s",$val.log_time)}</td>
                            <td align="center" data-off="true" class="layui-table-col-special">
        					    <div class="layui-table-cell">
        						    <button type="button" class="layui-btn layui-btn-xs" onclick="openlog('日志查看','{:url('Log/edit')}'+'?id='+{$val.id}+'&ids='+{$val.user_id})"><i class="layui-icon layui-icon-edit"></i>查看</button>
        						</div>
        					</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="layui-box layui-laypage layui-laypage-molv">{$log|raw}</div>
        </div>
    </div>
</div>





	<!--_footer 作为公共模版分离出去-->
{include file='public/footer' }
	<!--/_footer /作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
  layui.config({
    base: '__ADMINST__layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'useradmin', 'table'], function(){
    var $ = layui.$
    ,form = layui.form
    ,table = layui.table;
  });

    
    //日志查看
    function openlog(title,url){
        layer.open({
            type:2,
            title:title,
            content:url,
            area:['40%','60%']
        });
    }
    

	//点击搜索
	function so(){
		var keywords = $("#keywords").val();
		if(keywords == ""){
			layer.msg("请输入搜索内容！",{time:2000});
		}else{
			layer.open({
				title:"搜索内容",
				type:2,
				area:['100%','100%'],
				content: "{:url('Log/search')}"+"?keywords="+keywords,
				end:function(){
					location.reload();
				}
			});
		}
		console.log(keywords);
	}



</script>
	<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
